﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace bci2.GameEngine
{
    class SequenceMatrix : Sprite
    {
        char[][] caratteri = { new char[] {'A','B','C','D','E','F'},
                               new char[] {'G','H','I','J','K','L'},
                               new char[] {'M','N','O','P','Q','R'},
                               new char[] {'S','T','U','V','W','X'},
                               new char[] {'Y','Z','0','1','2','3'},
                               new char[] {'4','5','6','7','8','9'} };
        int RAND_MAX = 6;
        protected bool flag = true, on = true;
        public SequenceMatrix(  List<table> rows,
                                List<table> cols,
                                Vector2 pos_mat)
            : base(rows, cols, pos_mat)
            { 
            }
        public override void Update(GameTime gameTime)
        {


            base.Update(gameTime);

        }

        public bool Flag{
            get{ return flag;}
            set{ flag = value;}
        }
        public bool On
        {
            get { return on; }
            set { on = value; }
        }

        public int Rand_max
        {
            get { return RAND_MAX; }
        }
        public char[][] Caratteri
        {
            get { return caratteri; }
        }

        /*  Segue la funzione che resetta la lista Table e setta il flag*/
        public void clearTable( List<table> tab)
        {
            int tru = 0;
            for (int count = 0; count < 6; count++)
            {
                if (tab.ElementAt(count).History)
                {
                    tru++;
                }
            }
            if (tru == 6)
            {
                for (int count = 0; count < 6; count++)
                {
                    tab.ElementAt(count).History = false;
                }
                this.flag = !this.flag;   // A questo punto abbiamo fatto anche le colonne e ricominciamo
            }
        }
    }
}
